package com.jiudian.manage.controller;

import com.jiudian.manage.mapper.LogMapper;
import com.jiudian.manage.model.Log;
import com.jiudian.manage.model.Result;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Classname LogController
 * @Description TODO
 * @Date 2021/12/6 11:28
 * @Created by Administrator
 */
@RestController
@RequestMapping(value = "/log")
public class LogController {

    @Resource
    private LogMapper logMapper;

    @PostMapping("/getLogs")
    public Result<?> getLogs(){
        List<Log> logs = logMapper.getLogs();
        return Result.success(logs);
    }

    @PostMapping("/insert")
    public Result<?> insert(String name,String identityCard,Integer roomId){
        logMapper.insert(new Log(null, name, identityCard, roomId,null));
        return Result.success();
    }
}
